home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet internetowy / Czytniki RSS / RSS Bandit 1.3.0.42 / RssBandit Installer.msi / _172FF5180BC61D3C6D240F14338A23AA / _C64267F8FFEA402E8B495508FE6CD3BB < prev    next >
Text File  |  2005-11-19  |  7KB  |  203 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.IO;
  7.  
  8. namespace BlogExtension.Delicious 
  9. {
  10.     public class DeliciousPostForm : System.Windows.Forms.Form
  11.     {
  12.         public string TemplateText;
  13.  
  14.         internal System.Windows.Forms.TextBox textUri;
  15.         private System.Windows.Forms.Label label2;
  16.         private System.Windows.Forms.Label label1;
  17.         private System.Windows.Forms.Label label3;
  18.         private System.Windows.Forms.Button btnPost;
  19.         private System.Windows.Forms.Button btnCancel;
  20.         internal System.Windows.Forms.TextBox textDescription;
  21.         internal System.Windows.Forms.TextBox textTags;
  22.         private System.ComponentModel.Container components = null;
  23.  
  24.  
  25.         public DeliciousPostForm(string url, string description)
  26.         {
  27.             InitializeComponent();
  28.             InitializeComponentTranslation();
  29.             textUri.Text = url; 
  30.             textDescription.Text = description;
  31.         }
  32.  
  33.         private void InitializeComponentTranslation() {
  34.             this.btnPost.Text = Resource.Manager["RES_DeliciousFormPost"];
  35.             this.btnCancel.Text = Resource.Manager["RES_DeliciousFormCancel"];
  36.             this.label2.Text = Resource.Manager["RES_DeliciousFormUrl"];
  37.             this.label1.Text = Resource.Manager["RES_DeliciousFormDescription"];
  38.             this.label3.Text = Resource.Manager["RES_DeliciousFormTags"];
  39.             this.Text = Resource.Manager["RES_MenuDeliciousCaption"];
  40.         }
  41.  
  42.         protected override void Dispose( bool disposing )
  43.         {
  44.             if( disposing )
  45.             {
  46.                 if (components != null) 
  47.                 {
  48.                     components.Dispose();
  49.                 }
  50.             }
  51.             base.Dispose( disposing );
  52.         }
  53.  
  54.         #region Windows Form Designer generated code
  55.         /// <summary>
  56.         /// Required method for Designer support - do not modify
  57.         /// the contents of this method with the code editor.
  58.         /// </summary>
  59.         private void InitializeComponent()
  60.         {
  61.             this.btnPost = new System.Windows.Forms.Button();
  62.             this.btnCancel = new System.Windows.Forms.Button();
  63.             this.textUri = new System.Windows.Forms.TextBox();
  64.             this.label2 = new System.Windows.Forms.Label();
  65.             this.textDescription = new System.Windows.Forms.TextBox();
  66.             this.label1 = new System.Windows.Forms.Label();
  67.             this.label3 = new System.Windows.Forms.Label();
  68.             this.textTags = new System.Windows.Forms.TextBox();
  69.             this.SuspendLayout();
  70.             // 
  71.             // btnPost
  72.             // 
  73.             this.btnPost.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  74.             this.btnPost.DialogResult = System.Windows.Forms.DialogResult.OK;
  75.             this.btnPost.Location = new System.Drawing.Point(240, 123);
  76.             this.btnPost.Name = "btnPost";
  77.             this.btnPost.TabIndex = 5;
  78.             this.btnPost.Text = "Post";
  79.             this.btnPost.Click += new System.EventHandler(this._btOK_Click);
  80.             // 
  81.             // btnCancel
  82.             // 
  83.             this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  84.             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  85.             this.btnCancel.Location = new System.Drawing.Point(328, 123);
  86.             this.btnCancel.Name = "btnCancel";
  87.             this.btnCancel.TabIndex = 4;
  88.             this.btnCancel.Text = "Cancel";
  89.             // 
  90.             // textUri
  91.             // 
  92.             this.textUri.AllowDrop = true;
  93.             this.textUri.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  94.                 | System.Windows.Forms.AnchorStyles.Right)));
  95.             this.textUri.Location = new System.Drawing.Point(88, 8);
  96.             this.textUri.Name = "textUri";
  97.             this.textUri.Size = new System.Drawing.Size(320, 20);
  98.             this.textUri.TabIndex = 38;
  99.             this.textUri.Text = "";
  100.             // 
  101.             // label2
  102.             // 
  103.             this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
  104.             this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
  105.             this.label2.Location = new System.Drawing.Point(8, 8);
  106.             this.label2.Name = "label2";
  107.             this.label2.Size = new System.Drawing.Size(72, 32);
  108.             this.label2.TabIndex = 37;
  109.             this.label2.Text = "&URL";
  110.             this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  111.             // 
  112.             // textDescription
  113.             // 
  114.             this.textDescription.AllowDrop = true;
  115.             this.textDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  116.                 | System.Windows.Forms.AnchorStyles.Right)));
  117.             this.textDescription.Location = new System.Drawing.Point(88, 48);
  118.             this.textDescription.Name = "textDescription";
  119.             this.textDescription.Size = new System.Drawing.Size(320, 20);
  120.             this.textDescription.TabIndex = 40;
  121.             this.textDescription.Text = "";
  122.             // 
  123.             // label1
  124.             // 
  125.             this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
  126.             this.label1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
  127.             this.label1.Location = new System.Drawing.Point(16, 48);
  128.             this.label1.Name = "label1";
  129.             this.label1.Size = new System.Drawing.Size(64, 32);
  130.             this.label1.TabIndex = 39;
  131.             this.label1.Text = "&Description";
  132.             this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  133.             // 
  134.             // label3
  135.             // 
  136.             this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
  137.             this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
  138.             this.label3.Location = new System.Drawing.Point(8, 88);
  139.             this.label3.Name = "label3";
  140.             this.label3.Size = new System.Drawing.Size(72, 32);
  141.             this.label3.TabIndex = 41;
  142.             this.label3.Text = "&Tags";
  143.             this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  144.             // 
  145.             // textTags
  146.             // 
  147.             this.textTags.Location = new System.Drawing.Point(88, 88);
  148.             this.textTags.Name = "textTags";
  149.             this.textTags.Size = new System.Drawing.Size(320, 20);
  150.             this.textTags.TabIndex = 42;
  151.             this.textTags.Text = "";
  152.             // 
  153.             // DeliciousPostForm
  154.             // 
  155.             this.AcceptButton = this.btnPost;
  156.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  157.             this.CancelButton = this.btnCancel;
  158.             this.ClientSize = new System.Drawing.Size(416, 157);
  159.             this.ControlBox = false;
  160.             this.Controls.Add(this.textTags);
  161.             this.Controls.Add(this.label3);
  162.             this.Controls.Add(this.textDescription);
  163.             this.Controls.Add(this.label1);
  164.             this.Controls.Add(this.textUri);
  165.             this.Controls.Add(this.label2);
  166.             this.Controls.Add(this.btnPost);
  167.             this.Controls.Add(this.btnCancel);
  168.             this.MaximizeBox = false;
  169.             this.MinimizeBox = false;
  170.             this.Name = "DeliciousPostForm";
  171.             this.Text = "Post to del.icio.us";
  172.             this.Closing += new System.ComponentModel.CancelEventHandler(this.DeliciousPostForm_Closing);
  173.             this.ResumeLayout(false);
  174.  
  175.         }
  176.         #endregion
  177.  
  178.         
  179.  
  180.         private void DeliciousPostForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  181.         {        
  182.     
  183.             if(this.DialogResult == DialogResult.Retry){
  184.                 e.Cancel = true; 
  185.             }
  186.         }
  187.  
  188.         private void _btOK_Click(object sender, System.EventArgs e)
  189.         {                    
  190.             
  191.             if((textDescription.Text.Length == 0) || 
  192.                 (textTags.Text.Length == 0) ||
  193.                 (textUri.Text.Length == 0)){
  194.                 
  195.                 MessageBox.Show(this, Resource.Manager["RES_DeliciousIncompleteSubmissionMessage"], Resource.Manager["RES_DeliciousIncompleteSubmissionTitle"],  MessageBoxButtons.OK, MessageBoxIcon.Error);
  196.                 this.DialogResult = DialogResult.Retry; 
  197.             }        
  198.             
  199.         }
  200.         
  201.     }
  202. }
  203.